package edu.usm.roberge.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.RootLayoutPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Golf_Scraper implements EntryPoint {

	private final GolfCourseServiceAsync golfCourseService = GWT.create(GolfCourseService.class);
	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		LayoutPanel pan = RootLayoutPanel.get();

		WeatherView wv = new WeatherView();
		pan.add(wv);
		pan.setWidgetLeftRight(wv, 50, Unit.EM, 0, Unit.EM);
		pan.setWidgetTopBottom(wv, 1, Unit.EM, 0, Unit.EM);
		PricesAsyncProvider gprov = new PricesAsyncProvider(golfCourseService);
		gprov.addDataDisplay(wv.getAirlinePriceView());
		WeatherAsyncProvider wap = new WeatherAsyncProvider(golfCourseService);
		wap.addDataDisplay(wv.getCellTable());

		GolfCourseAsyncProvider prov = new GolfCourseAsyncProvider(golfCourseService);
		Main main = new Main(gprov, prov, wap);
		pan.add(main);
		pan.setWidgetLeftWidth(main, 5, Unit.EM, 25, Unit.EM);
		pan.setWidgetTopBottom(main, 0, Unit.PCT, 0, Unit.EM);
	}
}
